home *** CD-ROM | disk | FTP | other *** search
/ WWII Attack! from Pearl Harbor to Potsdam / WWII Attack - From Pearl Harbor to Potsdam - Disc 3.iso / pc / us / shared.cst / 00059_Script_back click < prev    next >
Text File  |  1999-11-23  |  3KB  |  75 lines

  1. --*** A Simple click Button score behavior script ***
  2. --        Revised 12/7/97
  3.  
  4. property downSnd
  5. property upSnd
  6. property Action
  7. property WhichLabel
  8.  
  9. on mouseDown
  10.     set the puppet of sprite 3 to false
  11.   -- click "blip2"
  12.   Click downSnd, upSnd
  13.   -- 'mouseup' action
  14.   if rollover( clickon() ) then -- Apple Legal
  15.     play done
  16.   end if
  17. end
  18.  
  19. on getPropertyDescriptionList
  20.         global ibcDefaultParams
  21.   if listp(ibcDefaultParams) then
  22.     return ibcDefaultParams
  23.   else
  24.         set description = [:]
  25.     addProp     description,#DownSnd,[#default:"Silence",#format:#sound,#comment:"Down Sound Member:"]
  26.         addProp     description,#UpSnd,[#default:"Silence",#format:#sound,#comment:"Up Sound Member:"]
  27.     addProp     description,#Action,[#default: #"None",#range: [ #"None", #"Go to marker", #"Play marker" ], #format:#symbol,#comment:"MouseUp Action:"]
  28.     addProp description, #WhichLabel, [ #comment: "Destination Marker:",  #format: #marker, #default:  "next" ]
  29.     return description
  30.   end if
  31. end
  32.  
  33. on btnSound asoundName -- does a little validation
  34.   if stringp(asoundName) and asoundName <> "Silence" then
  35.     puppetSound asoundName
  36.   end if
  37. end
  38.  
  39. on  getBehaviorDescription
  40.   return "- Click Behavior -"¨
  41. & return & "Defined: controls a dual-image button."¨
  42. & return & "Intended Use: to give user a simple audio + visual feedback that they've engaged a control. Rolling off button during mouseDown will disengage."¨
  43. & return & return & "- Properties -"¨
  44.   & return & "Down Sound: assigns a mouseDown button sound."¨
  45.   & return & "Up Sound: assigns a mouseUp button sound."¨
  46. & return & "MouseUp Action: assigns a button course of action."¨
  47. & return & "  (Note: Select 'None' if you plan to add a seperate mouseUp behavior to this button)"¨
  48. & return & "Destination Marker: assigns a destination to the course of action."¨
  49. & return & return & "(Explore the 'LookHere' folder on the CD-Rom for examples of each behavior)"
  50. end
  51.  
  52. ---  the handler code ---
  53.  
  54. on click  downSound, upSound
  55.   
  56.   set emem = the membernum of sprite clickon()
  57.   if stringP(downSound) then btnSound downSound
  58.   updatestage
  59.   set the membernum of sprite clickon() = emem + 1
  60.   updatestage
  61.   repeat while the stillDown or soundBusy (1)
  62.     if rollover( clickon() ) then set the membernum of sprite clickon() = emem + 1 -- added Apple legal code
  63.     else set the membernum of sprite clickon() = emem
  64.     updateStage
  65.   end repeat
  66.   if stringP(upSound) and rollover( clickon()) then btnSound upSound
  67.   updatestage
  68.   set the membernum of sprite clickon() = emem
  69.   updatestage
  70.   repeat while soundBusy (1)
  71.   end repeat
  72.   puppetSound 0
  73.   updateStage
  74. end click
  75.